import request from '@/utils/request'

// 获取优惠券列表
export const getCouponsList = (data) => {
  return request({
    url: '/coupon/list',
    method: 'get',
    params:data
  })
}
// 保存优惠券
export const addCoupons = (data) => {
  return request({
    url: '/coupon/edit',
    method: 'post',
    data: data
  })
}

// 修改优惠券
export const editCoupons = (data) => {
  return request({
    url: '/coupon/edit',
    method: 'put',
    data: data
  })
}

// 获取优惠券详情
export const getCouponsDetail = (id) => {
  return request({
    url: '/coupon/'+id,
    method: 'get'
  })
}

// 删除优惠券
export const delCoupons = (id) => {
  return request({
    url: '/coupon/'+id,
    method: 'delete'
  })
}
